package com.hsylient.javase.chapter02.practice.demo02;

import com.hsylient.javase.chapter02.practice.demo02.version01.Extractor;
import com.hsylient.javase.chapter02.practice.demo02.version02.EmailExtractor;
import com.hsylient.javase.chapter02.practice.demo02.version02.IdCardExtractor;
import org.junit.Test;

import java.io.File;
import java.util.List;

public class TestExtract {

    @Test
    public void testEx() {
        File file = new File("./src/main/java/com/hsylient/oo/demo01/version01/string.txt");
        Extractor extractor = new Extractor();
        List<String> target = extractor.extract(file);
        target.forEach(System.out::println);
    }

    @Test
    public void testIdCardExtractor() {
        File file = new File("./src/main/java/com/hsylient/oo/demo01/version02/string.txt");
        IdCardExtractor idCardExtractor = new IdCardExtractor();
        List<String> idList = idCardExtractor.extract(file);
        idList.forEach(System.out::println);
    }

    @Test
    public void testEmailExtractor() {
        File file = new File("./src/main/java/com/hsylient/oo/demo01/version02/string.txt");
        EmailExtractor emailExtractor = new EmailExtractor();
        List<String> idList = emailExtractor.extract(file);
        idList.forEach(System.out::println);
    }
}
